package com.example.demo3.impl;

import com.example.demo3.LightSwitch;
import com.example.demo3.TrafficLight;

public class LightSwitchGreenImpl implements LightSwitch {
    @Override
    public void switchToRed(TrafficLight trafficLight) {
        System.out.println("不能直接切换成红灯");
    }

    @Override
    public void switchToGreen(TrafficLight trafficLight) {
        System.out.println("已经是绿灯了,不能重复切换");
    }

    @Override
    public void switchYellow(TrafficLight trafficLight) {
        System.out.println("黄灯亮起。。。。。。。");
    }
}
